home *** CD-ROM | disk | FTP | other *** search
- #include "help.h"
- #include "environment.h"
- #include "popup.h"
- #include "memory layer.h"
- #include "button layer.h"
- #include "text layer.h"
- #include "program globals.h"
- #include "window layer.h"
-
- #define DEAD_SPACE_TOP 10
- #define DEAD_SPACE_LEFT 10
- #define DEAD_SPACE_BOTTOM 5
- #define DEAD_SPACE_RIGHT 10
- #define TEXT_RECT_WIDTH 405
- #define TEXT_RECT_HEIGHT 250
- #define BUTTON_WIDTH 80
- #define BUTTON_HEIGHT 17
- #define BUTTON_GAP_H 15
- #define BUTTON_GAP_V 5
-
- #define MAX_MAIN_TOPICS 5
- #define MAX_SUB_TOPICS 6
-
- #define MAIN_TOPIC_ID 600
- #define POPUP_MENU_ID 100
-
- short gMainTopicShowing; /* saved in prefs file */
- short gSubTopicShowing; /* saved in prefs file */
-
- static short gNumMainTopics;
- static short gNumSubTopics[MAX_MAIN_TOPICS];
- static Str31 gMainTopicTitle[MAX_MAIN_TOPICS];
- static Rect gMainTopicRect[MAX_MAIN_TOPICS];
- static Str31 gSubTopicTitle[MAX_MAIN_TOPICS][MAX_SUB_TOPICS];
- static short gSubTopicID[MAX_MAIN_TOPICS][MAX_SUB_TOPICS];
- static Rect gTextRect;
- static Handle gTheText;
- static Handle gTheStyle;
-
- static Boolean gSetupDone=FALSE;
-
- /*-----------------------------------------------------------------------------------*/
- /* internal stuff for help.c */
-
- static short ParseRawTitle(Str255 theTitle);
- static void GoToPage(WindowRef theWindow, short mainTopic, short subTopic,
- Boolean updateNow);
- static void GetTextResources(short mainTopic, short subTopic);
- static void DisposeTextResources(void);
-
- void SetupTheHelpWindow(WindowRef theWindow)
- {
- short i,j;
- unsigned char *titleStr="\pHelp";
- Handle temp;
- short strID;
- Point thePoint;
-
- SetWindowMaxDepth(theWindow, 8);
- SetWindowWidth(theWindow, DEAD_SPACE_LEFT+TEXT_RECT_WIDTH+DEAD_SPACE_RIGHT);
- SetWindowHeight(theWindow, BUTTON_GAP_V+DEAD_SPACE_TOP+BUTTON_HEIGHT+TEXT_RECT_HEIGHT+
- DEAD_SPACE_BOTTOM);
- SetWindowAttributes(theWindow, kHasCloseBoxMask+kHasDocumentTitlebarMask);
- thePoint.v=50;
- thePoint.h=6;
- SetWindowTopLeft(theWindow, thePoint);
- SetWindow